#ifndef MULTI_H
#define MULTI_H
#include <QWidget>
#include <QListWidget>
#include <string>
#include <QTcpSocket>
#include "SimpleCrypt.h"

namespace Ui {
class multi;
}

class multi : public QWidget
{
    Q_OBJECT

public:
    explicit multi(QWidget *parent = 0);
    ~multi();
    QStringList server_details;
    void updateServer(QStringList);

public slots:
    /** \brief Requests a list of available servers from the registration server.
        * \param client is a QTcpSocket client to which JSON encoded messages will be sent. */
    QStringList requestServerList();

private slots:
    void on_btnBack_clicked();

    void on_btnJoin_clicked();

    // reg server

    void regServerConnected();

    void regServerRead();

    void on_btnJoinAI_clicked();

    void on_lstServer_itemClicked(QListWidgetItem *item);

private:
    Ui::multi *ui;

    QTcpSocket *regServerSocket;

    QString server_list;

    QStringList server_ips;

    QStringList server_ports;

    QStringList server_names;

    SimpleCrypt *crypto;

signals:
    void goback();
    void gogame();
    void signalClient(QStringList);
};

#endif // MULTI_H
